Global Const AF_DLI = 13 '/* Direct data link interface */
Global Const AF_LAT = 14 '/* LAT */
Global Const AF_HYLINK = 15 '/* NSC Hyperchannel */
Global Const AF_APPLETALK = 16 '/* AppleTalk */
Global Const AF_NETBIOS = 17 '/* NetBios-style addresses */
Global Const AF_MAX = 18
'/*
' * Level number for (get/set)sockopt() to apply to socket itself.
' */
Global Const SOL_SOCKET = &HFFFF '/* options for socket level */
''/*
' * Maximum queue length specifiable by listen.
' */
Global Const SOMAXCONN = 5
Global Const MSG_OOB = &H1 '/* process out-of-band data */
Global Const MSG_PEEK = &H2 '/* peek at incoming message */
Global Const MSG_DONTROUTE = &H4 '/* send without using routing tables */
Global Const MSG_MAXIOVLEN = 16
'/*
' * Define constant based on rfc883, used by gethostbyxxxx() calls.
' */
Global Const MAXGETHOSTSTRUCT = 1024
'/*
' * Define flags to be used with the WSAAsyncSelect() call.
' */
Global Const FD_READ = &H1
Global Const FD_WRITE = &H2
Global Const FD_OOB = &H4
Global Const FD_ACCEPT = &H8
Global Const FD_CONNECT = &H10
Global Const FD_CLOSE = &H20
'/* Additional VB_STAK flags
Global Const STAK_EVENT_SERVICE = &H40
Global Const STAK_EVENT_HOST = &H80
Global Const STAK_EVENT_PROTOCOL = &H100
Global Const STAK_EVENT_READ = &H1
Global Const STAK_EVENT_WRITE = &H2
Global Const STAK_EVENT_OOB = &H4
Global Const STAK_EVENT_ACCEPT = &H8
Global Const STAK_EVENT_CONNECT = &H10
Global Const STAK_EVENT_CLOSE = &H20
'/*
' * All Windows Sockets error constants are biased by WSABASEERR from
'* the "normal"
' */
Global Const WSABASEERR = 10000
Global Const WS_ERROR = &H4000
Global Const WS_ERROR_INVALID_ADDRESS = &H4001
'/*
' * Windows Sockets definitions of regular Microsoft C error constants
' */
'VB Note: reference to the following error codes requires an offset of
' WSBASEERR
' eg. if WSAGetLastError() = WSBASEERR+WSAEINTR then ...
'
' I use a WSerrorCheck() function to get and verify error codes
Global Const WSAEINTR = 4
Global Const WSAEBADF = 9
Global Const WSAEACCES = 13
Global Const WSAEFAULT = 14
Global Const WSAEINVAL = 22
Global Const WSAEMFILE = 24
'/*
' * Windows Sockets definitions of regular Berkeley error constants
' */
Global Const WSAEWOULDBLOCK = 35
Global Const WSAEINPROGRESS = 36
Global Const WSAEALREADY = 37
Global Const WSAENOTSOCK = 38
Global Const WSAEDESTADDRREQ = 39
Global Const WSAEMSGSIZE = 40
Global Const WSAEPROTOTYPE = 41
Global Const WSAENOPROTOOPT = 42
Global Const WSAEPROTONOSUPPORT = 43
Global Const WSAESOCKTNOSUPPORT = 44
Global Const WSAEOPNOTSUPP = 45
Global Const WSAEPFNOSUPPORT = 46
Global Const WSAEAFNOSUPPORT = 47
Global Const WSAEADDRINUSE = 48
Global Const WSAEADDRNOTAVAIL = 49
Global Const WSAENETDOWN = 50
Global Const WSAENETUNREACH = 51
Global Const WSAENETRESET = 52
Global Const WSAECONNABORTED = 53
Global Const WSAECONNRESET = 54
Global Const WSAENOBUFS = 55
Global Const WSAEISCONN = 56
Global Const WSAENOTCONN = 57
Global Const WSAESHUTDOWN = 58
Global Const WSAETOOMANYREFS = 59
Global Const WSAETIMEDOUT = 60
Global Const WSAECONNREFUSED = 61
Global Const WSAELOOP = 62
Global Const WSAENAMETOOLONG = 63
Global Const WSAEHOSTDOWN = 64
Global Const WSAEHOSTUNREACH = 65
Global Const WSAENOTEMPTY = 66
Global Const WSAEPROCLIM = 67
Global Const WSAEUSERS = 68
Global Const WSAEDQUOT = 69
Global Const WSAESTALE = 70
Global Const WSAEREMOTE = 71
'/*
' * Extended Windows Sockets error constant definitions
' */
Global Const WSASYSNOTREADY = 91
Global Const WSAVERNOTSUPPORTED = 92
Global Const WSANOTINITIALISED = 93
'/*
' * Error return codes from gethostbyname( and gethostbyaddr()
' * (when using the resolver). Note that these errors are
' * retrieved via WSAGetLastError() and must therefore follow
' * the rules for avoiding clashes with error numbers from
' * specific implementations or language run-time systems.
' * For this reason the codes are based at 1000+1001.
' * Note also that [WSA]NO_ADDRESS is defined only for
' * compatibility purposes.
' */
'/* Authoritative Answer: Host not found */
Global Const WSAHOST_NOT_FOUND = 1001
Global Const HOST_NOT_FOUND = 1001
'/* Non-Authoritative: Host not found, or SERVERFAIL */
Global Const WSATRY_AGAIN = 1002
Global Const TRY_AGAIN = 1002
'/* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
Global Const WSANO_RECOVERY = 1003
Global Const NO_RECOVERY = 1003
'/* Valid name, no data record of requested type */
Global Const WSANO_DATA = 1004
Global Const NO_DATA = 1004
'/* no address, look for MX record */
Global Const WSANO_ADDRESS = 1004
Global Const NO_ADDRESS = 1004
'/*
' * Windows Sockets errors redefined as regular Berkeley error constants
' */
Global Const EWOULDBLOCK = 35
Global Const EINPROGRESS = 36
Global Const EALREADY = 37
Global Const ENOTSOCK = 38
Global Const EDESTADDRREQ = 39
Global Const EMSGSIZE = 40
Global Const EPROTOTYPE = 41
Global Const ENOPROTOOPT = 42
Global Const EPROTONOSUPPORT = 43
Global Const ESOCKTNOSUPPORT = 44
Global Const EOPNOTSUPP = 45
Global Const EPFNOSUPPORT = 46
Global Const EAFNOSUPPORT = 47
Global Const EADDRINUSE = 48
Global Const EADDRNOTAVAIL = 49
Global Const ENETDOWN = 50
Global Const ENETUNREACH = 51
Global Const ENETRESET = 52
Global Const ECONNABORTED = 53
Global Const ECONNRESET = 54
Global Const ENOBUFS = 55
Global Const EISCONN = 56
Global Const ENOTCONN = 57
Global Const ESHUTDOWN = 58
Global Const ETOOMANYREFS = 59
Global Const ETIMEDOUT = 60
Global Const ECONNREFUSED = 61
Global Const ELOOP = 62
Global Const ENAMETOOLONG = 63
Global Const EHOSTDOWN = 64
Global Const EHOSTUNREACH = 65
Global Const ENOTEMPTY = 66
Global Const EPROCLIM = 67
Global Const EUSERS = 68
Global Const EDQUOT = 69
Global Const ESTALE = 70
Global Const EREMOTE = 71
' Errors
Global Const WSANOTINITIALISED_S = "A successful WSAStartup() must occur before using this API."
Global Const WSAENETDOWN_S = "The Windows Sockets implementation has detected that the network subsystem has failed."
Global Const WSAEADDRINUSE_S = "The specified address is already in use. (See the SO_REUSEADDR socket option under setsockopt().)"
Global Const WSAEFAULT_S = "The namelen argument is too small (less than the size of a struct sockaddr)."
Global Const WSAEINTR_S = "The (blocking) call was canceled via WSACancelBlockingCall()"
Global Const WSAEINPROGRESS_S = "A blocking Windows Sockets call is in progress."
Global Const WSAEAFNOSUPPORT_S = "The specified address family is not supported by this protocol."
Global Const WSAEINVAL_S = "The socket is already bound to an address."
Global Const WSAENOBUFS_S = " Not enough buffers available, too many connections."
Global Const WSAENOTSOCK_S = "The descriptor is not a socket."
Global Const WSAEADDRNOTAVAIL_S = "The specified address is not available from the local machine."
Global Const WSAECONNREFUSED_S = "The attempt to connect was forcefully rejected."
Global Const WSAEDESTADDREQ_S = "A destination address is required."
Global Const WSAEISCONN_S = "The socket is already connected."
Global Const WSAEMFILE_S = "No more file descriptors are available."
Global Const WSAENETUNREACH_S = "The network can't be reached from this host at this time."
Global Const WSAETIMEDOUT_S = "Attempt to connect timed out without establishing a connection"
Global Const WSAEWOULDBLOCK_S = "The socket is marked as non-blocking and the connection cannot be completed immediately. It is possible to select() the socket while it is connecting by select()ing it for writing."
Global Const WSAHOST_NOT_FOUND_S = "Authoritative Answer Host not found."
Global Const WSATRY_AGAIN_S = "Non-Authoritative Host not found, or SERVERFAIL."
Global Const WSANO_RECOVERY_S = "Non recoverable errors, FORMERR, REFUSED, NOTIMP."
Global Const WSANO_DATA_S = "Valid name, no data record of requested type."
Global Const WSAENOPROTOOPT_S = "The option is unknown or unsupported. In particular."
Global Const WSAEACCES_S = "The requested address is a broadcast address, but the appropriate flag was not set."
Global Const WSAENETRESET_S = "The connection must be reset because the Windows Sockets implementation dropped it."
Global Const WSAENOTCONN_S = "The socket is not connected."
Global Const WSAEOPNOTSUPP_S = "MSG_OOB was specified, but the socket is not of type SOCK_STREAM."
Global Const WSAESHUTDOWN_S = "The socket has been shutdown; it is not possible to send() on a socket after shutdown() has been invoked with how set to 1 or 2."
Global Const WSAEMSGSIZE_S = "The socket is of type SOCK_DGRAM, and the datagram is larger than the maximum supported by the Windows Sockets implementation."
Global Const WSAECONNABORTED_S = "The virtual circuit was aborted due to timeout or other failure."
Global Const WSAECONNRESET_S = "The virtual circuit was reset by the remote side."